package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

@Getter
public enum PoliticalOutlookEnum {
    LEAGUE_MEMBER("3", "共青团员", "3", null),
    COMMUNIST_PARTY("1", "中共党员", "1", null),
    THE_ASSES("12", "群众", "13", null),
    PROBATIONARY_PARTY_MEMBER("2", "中共预备党员", "2", null),
    UNKNOWN("UNKNOWN", "未知", "12", null);

    /**
     * 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    PoliticalOutlookEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static PoliticalOutlookEnum toCode(String sourceCode) {
        for (PoliticalOutlookEnum value : PoliticalOutlookEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNKNOWN;
    }
}
